package objects 
{
	/**
	 * ...
	 * @author Vượng
	 */
	import objects.MyObject;
	public class BoomManager 
	{
		protected var m_listBoom : Array;
		
		public function BoomManager() 
		{
			m_listBoom = new Array();
		}
		public function getBoom ( index : int) : Boom {
			
			return m_listBoom[index];
		}
		public function update ( dt : Number):void
		{
			for ( var i : int = 0; i < m_listBoom.length; i++)
			{
				m_listBoom[i].update(1/60);
			}
		}
		public function Collision ( _enemy : MyObject, dt : Number) : void
		{
			for ( var i : int = 0; i < m_listBoom.length; i++)
			{
				m_listBoom[i].Collision (_enemy, dt);
				if ( m_listBoom[i].m_collision == true)
				{
					m_listBoom[i].release();
					m_listBoom.splice (i, 1);
				}
			}
			
		}
		public function addBoom (_boom : Boom) :void
		{
			m_listBoom.push (_boom);
		}
		public function getListBoom () : Array
		{
			return m_listBoom;
		}
	}

}